package com.ms.service.module.account.accountloginblocker;

import java.util.ArrayList;

import com.ms.service.module.account.accountloginblocker.db.AccountLoginIPBlockLogModel;

public class AccountLoginIPDisableData {
	
	public AccountLoginIPDisableData(){
		
	}
	
	public AccountLoginIPDisableData(String ip, String accountId, ArrayList<String> loginTimes, long lockTime, long unLockTime){
		this.ip = ip;
		this.accountId = accountId;
		this.loginTimes = loginTimes;
		this.lockTime = lockTime;
		this.unLockTime = unLockTime;
	}
	
	/**
	 * IP
	 */
	private String ip;

	/**
	 * 帳號ID
	 */
	private String accountId;

	/**
	 * 鎖定時的登錄歷程 (秒)
	 */
	private ArrayList<String> loginTimes;

	/**
	 * 鎖定時間 (秒)
	 */
	private long lockTime;

	/**
	 * 解鎖時間 (秒)
	 */
	private long unLockTime;
	
	/**
	 * 轉成 AccountLoginBlockLogModel
	 * @return
	 */
	public AccountLoginIPBlockLogModel tranToModel(int status){
		AccountLoginIPBlockLogModel model = new AccountLoginIPBlockLogModel();
		model.setIp(this.ip);
		model.setAccountId(this.accountId);
		model.setLoginTimes(this.loginTimes.toString());
		model.setLockTime(this.getLockTime());
		model.setUnLockTime(this.getUnLockTime());
		model.setLockStatus(status);
		return model;
	}
	
	
	///////////GS////////////

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public ArrayList<String> getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(ArrayList<String> loginTimes) {
		this.loginTimes = loginTimes;
	}

	public long getLockTime() {
		return lockTime;
	}

	public void setLockTime(long lockTime) {
		this.lockTime = lockTime;
	}

	public long getUnLockTime() {
		return unLockTime;
	}

	public void setUnLockTime(long unLockTime) {
		this.unLockTime = unLockTime;
	}
}
